UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KVmmndGyc1rQKTw6ZwTwtnH6sxTH6mtw0ZQUtvrtD/4=' 
WHERE 
  key_id = '7962468aae4e431c9ca5d08d8c014872eb9b483550a718675d241f7edc9f2dba' 
  AND (
    token = 'KVmmndGyc1rQKTw6ZwTwtnH6sxTH6mtw0ZQUtvrtD/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048