UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mUChzMysQ30KmI0+jupZwGUE8xTJBFZjnPaIT2BUWak='
WHERE
key_id = '242c00da3af71537f2ce6e49681c03c4c62812dca47edecb24835a7902fb338d'
AND (
token = 'mUChzMysQ30KmI0+jupZwGUE8xTJBFZjnPaIT2BUWak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)