UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qeKg/8mZl2tU/4V+aAV/zqZnKPmISwgg0MNkDqG/iwU='
WHERE
key_id = '143d78771698b7204af99d2266a67ec65d06d596797de91dbb4a7525f0d996bc'
AND (
token = 'qeKg/8mZl2tU/4V+aAV/zqZnKPmISwgg0MNkDqG/iwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)