UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EyvEJz5/hEF4j9r4ccBzrauzHt3H4cNsDpoGBG3fK4o='
WHERE
key_id = '71c740057cc33a0c080a17ca7bdbff351f59cf5e37034f92c47d18b0bc173338'
AND (
token = 'EyvEJz5/hEF4j9r4ccBzrauzHt3H4cNsDpoGBG3fK4o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)