UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FSVglUNaO06DHGd/Zn13tW5WwPsMYJV7DtFDBc6GcJ0=' 
WHERE 
  key_id = '70ded8376c1a4b510c2ac44e6594a88a6c3cd818176e57bc825661828d99c125' 
  AND (
    token = 'FSVglUNaO06DHGd/Zn13tW5WwPsMYJV7DtFDBc6GcJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028