UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1mer14YZPLyb5a1dwirPHL3CNC7HVPz5f43BDrasU4w='
WHERE
key_id = 'd7e80f0d28de0551efb674b67581bbe6df774a35d81275cc24b00f508b7d8299'
AND (
token = '1mer14YZPLyb5a1dwirPHL3CNC7HVPz5f43BDrasU4w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)