UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'U+ep+fGnDT2CAWU9TO+lBNsSFJ2GyVVqc0vBVDXGL7k='
WHERE
key_id = '84f4995f66142a5824502d5ca3513f4150ef54ab4a5f7bbdb31e2d70440de94b'
AND (
token = 'U+ep+fGnDT2CAWU9TO+lBNsSFJ2GyVVqc0vBVDXGL7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)