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

Query time 0.00038