UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HEnGSIImRB3CBOS9Mb7yhBcynb+fplkjubPA//3yJt0=' 
WHERE 
  key_id = 'cb6b382d7c6bbd9d40eec924c8bb62ee155ce064440567d9ac05f9c5af3c3581' 
  AND (
    token = 'HEnGSIImRB3CBOS9Mb7yhBcynb+fplkjubPA//3yJt0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018