UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f0jKhv5W/Gj2Euoq5Xhwv1hi1GFV+ISS5fuMr5VsHpc='
WHERE
key_id = '04870e4667aeeb4545c3a27db1010cf2e4ecd32c25e041db09e07efce87d7248'
AND (
token = 'f0jKhv5W/Gj2Euoq5Xhwv1hi1GFV+ISS5fuMr5VsHpc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)