UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c2DJemZCqc3WfH2s9jcZAZkRFGiZMoXA8ZUd71rEiUI='
WHERE
key_id = 'd06b4cd14845490fee57f777bf974e59247acf0cd2e7aa03898f628bf52f2270'
AND (
token = 'c2DJemZCqc3WfH2s9jcZAZkRFGiZMoXA8ZUd71rEiUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)