UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dCkGkCdC10hF5tn90OSmwI3024muD2gN0zI/GnbNt8w='
WHERE
key_id = 'ef183db4848d43944244d1b932f221427cea8739a453af9befb0a45ce43e8dea'
AND (
token = 'dCkGkCdC10hF5tn90OSmwI3024muD2gN0zI/GnbNt8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)