UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'C8DJdr9XVOsWGnBEQFJ6os97XmG9a/cQsQZXB07mevM=' 
WHERE 
  key_id = 'f495911b00022b2d8cce1e351850ba770e96d76a5c54f2e86b6e752b91208b1d' 
  AND (
    token = 'C8DJdr9XVOsWGnBEQFJ6os97XmG9a/cQsQZXB07mevM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045