UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EcSm46HZdJiL2jGx2iq+8lx79eRVOBjvXNwJmZlbgw4=' 
WHERE 
  key_id = '2c26f029b7d6f577d3c8706be19b1c3aa6049206d170d400c5e0675bdf315e97' 
  AND (
    token = 'EcSm46HZdJiL2jGx2iq+8lx79eRVOBjvXNwJmZlbgw4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042