UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vEuKfo5WaIB/A3XwiQUxw/aGRtyBxg/WDY5sgjtqFuQ='
WHERE
key_id = '6c2c7fad6cbc7b48b01155c47566c09dbd77a3e3da133b3ba28f8faae2c540cc'
AND (
token = 'vEuKfo5WaIB/A3XwiQUxw/aGRtyBxg/WDY5sgjtqFuQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)