UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TXBZwWZx/wq0V3lZVYestK7HlQhcXeR1dap0VvMb5kE=' 
WHERE 
  key_id = '5fbe7b5e0bd7e8d41f19d4ddc743823ed4c3b9cc8702664c93b65f35acee575e' 
  AND (
    token = 'TXBZwWZx/wq0V3lZVYestK7HlQhcXeR1dap0VvMb5kE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044