UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UNCVorIuWk6woKCmbdf2MvSNSObm1GIadve8LdNzyJk=' 
WHERE 
  key_id = 'c6085949336a1d09e0c85d95a276c8b31502ad5b042e7bab447919be17cb33f3' 
  AND (
    token = 'UNCVorIuWk6woKCmbdf2MvSNSObm1GIadve8LdNzyJk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00051