UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ajdioq0RCZnXRtYROaKst2/XtfC9BEayk3QofpEi8Io=' 
WHERE 
  key_id = '03a016ea9a7a868c77bd0eebb4b61fa0e868858a4f98984fcd37a9451994caff' 
  AND (
    token = 'ajdioq0RCZnXRtYROaKst2/XtfC9BEayk3QofpEi8Io=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024