UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YKLwpNx/t+itbDk5r48v5XOL6MQinvSB+om8zFQznIA=' 
WHERE 
  key_id = '32a2abac211bf3ef8e6f427760db53a6b292309ef294ce70e03a7bdfdf76a83d' 
  AND (
    token = 'YKLwpNx/t+itbDk5r48v5XOL6MQinvSB+om8zFQznIA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047