UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fusFSBa52+ac68cNp+/Y7SF3zUPX4rMQZ40dKu6RMLs=' 
WHERE 
  key_id = '61e2948ea0de4cde8f3a73cd6c17745ec166eac4ecf3f7c6f24af9ccaf998e86' 
  AND (
    token = 'fusFSBa52+ac68cNp+/Y7SF3zUPX4rMQZ40dKu6RMLs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027