UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'N+ikL66bHDXSoDd5jHMn8lkMe/7Z4hCLQOphElnvHAM='
WHERE
key_id = 'ade6f16a80efe5dce980bbf935cb2c7ba35347255e76a6ec97ce1ad5401ee635'
AND (
token = 'N+ikL66bHDXSoDd5jHMn8lkMe/7Z4hCLQOphElnvHAM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)