UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8WGKk/HT4BuZD+3UFVKfwy+RXRqP5wC+kQzwqa+s0Xo=' 
WHERE 
  key_id = '6c5f1441d2504f5c0ef583a39a3692a732deff7eba01afda23ee58b5877fc983' 
  AND (
    token = '8WGKk/HT4BuZD+3UFVKfwy+RXRqP5wC+kQzwqa+s0Xo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039