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

Query time 0.00019