UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ryz87rCDZb1wmF1af2hWSsIk0SC2aCjMrVux694Oy5s=' 
WHERE 
  key_id = '9e5b7cd09e648d5e3db2bf095410830d3f621aca28f8aeeb6294ffa28c1bc15a' 
  AND (
    token = 'ryz87rCDZb1wmF1af2hWSsIk0SC2aCjMrVux694Oy5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035