UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fbrpo08QsH//G9iRbzX2OAblEjvmj1272FjONXvLQzg='
WHERE
key_id = 'ce14b2ab1fd81d0602a44a0228e6e133b8fb2eea4ea0b438cf86fd843910aa93'
AND (
token = 'fbrpo08QsH//G9iRbzX2OAblEjvmj1272FjONXvLQzg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)