UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IuHIxrBqyp6l9zC0fsfI48WuU/O/V/2ME1H+qvjzDRw=' 
WHERE 
  key_id = '84bcae00402081a96b62b5286377f36655707d54f6f17ce1fbc150e94bec833f' 
  AND (
    token = 'IuHIxrBqyp6l9zC0fsfI48WuU/O/V/2ME1H+qvjzDRw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030